#include "FileController.h"
#include "HttpServer.h"
#include "TestController.h"

int main(int argc, char *argv[])
{
#if 1
    auto server = std::make_shared<HttpServer>("0.0.0.0", 10010);
    server->addController(new TestController());
    server->addController(new FileController("./static/"));
    server->start();
#else
    HttpClientBuilder builder("localhost", 8001);
    httplib::Client  *cli = builder.build();

    if (auto res = cli->Get("/")) {
        if (res->status == 200) {
            std::cout << res->body << std::endl;
        }
    } else {
        auto err = res.error();
        std::cout << "HTTP error: " << httplib::to_string(err) << std::endl;
    }

#endif
    return 0;
}
